﻿using System.IO;
using Styx;
using Styx.Helpers;
using System.ComponentModel;
using DefaultValue = Styx.Helpers.DefaultValueAttribute;
using Styx.Common;
using Styx.Common.Helpers;
using System.Windows.Forms;
using System.Reflection;

namespace KingWoW
{
    [Obfuscation(Exclude = true)] 
    public class FrostMageSettings : Settings
    {
        public static FrostMageSettings Instance = new FrostMageSettings();

        public string path_name = Path.Combine(Styx.Common.Utilities.AssemblyDirectory, string.Format(@"KingWOWCurrentSettings/FrostMage/FrostMage-Settings-{0}.xml", StyxWoW.Me.Name));

        public FrostMageSettings()
            : base(Path.Combine(Styx.Common.Utilities.AssemblyDirectory, string.Format(@"KingWOWCurrentSettings/FrostMage/FrostMage-Settings-{0}.xml", StyxWoW.Me.Name)))
        {
        }

        public enum TargetType
        {
            MANUAL,
            AUTO
        }

        [Setting]
        [DefaultValue(false)]
        [Category("MOVEMENT")]
        [DisplayName("Auto Move")]
        [Description("Enable/disable CC movement")]
        public bool movementEnabled { get; set; }

        [Setting]
        [DefaultValue(false)]
        [Category("DECURSE")]
        [DisplayName("UseDecurse")]
        [Description("Autocast remove curse on friends")]
        public bool UseDecurse { get; set; }

        [Setting]
        [DefaultValue(true)]
        [Category("INTERRUPT")]
        [DisplayName("autointerrupt")]
        [Description("Cast counterspell if target casting and interrumpible")]
        public bool AutoInterrupt { get; set; }

        [Setting]
        [DefaultValue(200)]
        [Category("INTERRUPT")]
        [DisplayName("Interrupt_MIN_Time")]
        [Description("Interrupt if enemy cast time between Interrupt_MIN_Time and Interrupt_MAX_Time")]
        public int Interrupt_MIN_Time { get; set; }

        [Setting]
        [DefaultValue(300)]
        [Category("INTERRUPT")]
        [DisplayName("Interrupt_MAX_Time")]
        [Description("Interrupt if enemy cast time between Interrupt_MIN_Time and Interrupt_MAX_Time")]
        public int Interrupt_MAX_Time { get; set; }

        [Setting]
        [DefaultValue(true)]
        [Category("MOVEMENT")]
        [DisplayName("AutoFacingTarget")]
        [Description("Enable/Disable autofacing current target")]
        public bool AutofaceTarget { get; set; }

        [Setting]
        [DefaultValue(TargetType.AUTO)]
        [Category("TARGETTING")]
        [DisplayName("TargetTypeSelected")]
        [Description("AUTO/MANUAL enable/disable autotargeting")]
        public TargetType TargetTypeSelected { get; set; }

        [Setting]
        [DefaultValue(28)]
        [Category("PULL")]
        [DisplayName("PullDistance")]
        [Description("Distance to pull from")]
        public float PullDistance { get; set; }

        [Setting]
        [DefaultValue(true)]
        [Category("PET")]
        [DisplayName("Use Pet")]
        [Description("enable/disable Pet")]
        public bool UsePet { get; set; }

        [Setting]
        [DefaultValue(true)]
        [Category("PET")]
        [DisplayName("UsePetFreeze")]
        [Description("enable/disable Use of Pet Freeze spell")]
        public bool UsePetFreeze { get; set; }

        [Setting]
        [DefaultValue(true)]
        [Category("ICE BARRIER")]
        [DisplayName("UseIcebarrier")]
        [Description("Enable/disable use of Ice barrier")]
        public bool UseIcebarrier { get; set; }

        [Setting]
        [DefaultValue(80)]
        [Category("ICE BARRIER")]
        [DisplayName("IcebarrierHP")]
        [Description("Use Ice barrier if my HP lower than this value")]
        public int IcebarrierHP { get; set; }

        [Setting]
        [DefaultValue(true)]
        [Category("BUFF")]
        [DisplayName("Autobuff brillance")]
        [Description("chose if buff arcane brillance automatic or manual")]
        public bool AutoBuffBrillance { get; set; }

        [Setting]
        [DefaultValue(true)]
        [Category("BUFF")]
        [DisplayName("AutoCast Ice Floes on moving")]
        [Description("AutoCast Ice Floes on moving (if talented)")]
        public bool autoIceFloes { get; set; }

        [Setting]
        [DefaultValue(20)]
        [Category("REST")]
        [DisplayName("Drink mana%")]
        [Description("Drink at % mana")]
        public int ManaPercent { get; set; }

        [Setting]
        [DefaultValue(0)]
        [Category("REST")]
        [DisplayName("Eat hp%")]
        [Description("Eat at % hp")]
        public int HealthPercent { get; set; }

        [Setting]
        [DefaultValue(8)]
        [Category("AOE")]
        [DisplayName("Blizzard AOE on #mobs")]
        [Description("use Blizzard AOE spells if mobs number >= this value")]
        public int BlizzardAOECount { get; set; }


        [Setting]
        [DefaultValue(false)]
        [Category("AOE")]
        [DisplayName("AvoidAOESpells")]
        [Description("Try to avoid AOE spells ")]
        public bool AvoidAOE { get; set; }     

        [Setting]
        [DefaultValue(3)]
        [Category("PRISMATIC CRYSTAL")]
        [DisplayName("PrismaticCrystalEnemiesNum")]
        [Description("use prismatic crystal if mobs number arount 8y of my main target are greater than this value")]
        public int PrismaticCrystalEnemiesNum { get; set; }

        [Setting]
        [DefaultValue(false)]
        [Category("PRISMATIC CRYSTAL")]
        [DisplayName("Use PrismaticCrystal ONLY on Burst Hotkey")]
        [Description("Use PrismaticCrystal ONLY on Burst Hotkey")]
        public bool PrismaticCrystalOnlyOnBurst { get; set; }  

        public enum CDUseType
        {
            COOLDOWN,
            BOSS,
            MANUAL,
            OnBURSTHOTKEY
        }

        [Setting]
        [DefaultValue(CDUseType.COOLDOWN)]
        [Category("CD")]
        [DisplayName("Use Icy Veins on")]
        [Description("Chose when use Icy Veins CD")]
        public CDUseType CDUseIcyVeins { get; set; }

        [Setting]
        [DefaultValue(CDUseType.COOLDOWN)]
        [Category("CD")]
        [DisplayName("Use Mirror Image on")]
        [Description("Chose when use your Mirror Image CD")]
        public CDUseType CDUseMirrorImage { get; set; }

        [Setting]
        [DefaultValue(true)]
        [Category("CD")]
        [DisplayName("AutoCastFrozerOrb")]
        [Description("Chose if AutoCast FrozerOrb (you can disable it questing")]
        public bool AutoFrozerOrb { get; set; }

        [Setting]
        [DefaultValue(false)]
        [Category("CROWD CONTROL")]
        [DisplayName("Use Deep Freeze")]
        [Description("Chose to enable/disable Deep Freeze")]
        public bool UseDeepFreeze { get; set; }

        [Setting]
        [DefaultValue(false)]
        [Category("CROWD CONTROL")]
        [DisplayName("UseRingOfFrost")]
        [Description("Chose to enable/disable use of ring of frost")]
        public bool UseRingOfFrost { get; set; }

        [Setting]
        [DefaultValue(false)]
        [Category("CROWD CONTROL")]
        [DisplayName("IceWardOnTank")]
        [Description("chose if automaticallycast Ice ward on Tank")]
        public bool IceWardOnTank { get; set; }    

        [Setting]
        [DefaultValue(true)]
        [Category("SPECIAL")]
        [DisplayName("AutoDismountOnCombat")]
        [Description("Auto start combat rotation when in combat and mounted")]
        public bool AutoDismountOnCombat { get; set; }

        [Setting]
        [DefaultValue(false)]
        [Category("SPECIAL")]
        [DisplayName("Use Blink")]
        [Description("Chose to enable/disable automatic Blink")]
        public bool UseBlink { get; set; }

        [Setting]
        [DefaultValue(true)]
        [Category("CONE OF COLD")]
        [DisplayName("Use ConeOfCold")]
        [Description("Chose to enable/disable cone of cold when facing mob")]
        public bool UseConeOfCold { get; set; }

        [Setting]
        [DefaultValue(3)]
        [Category("CONE OF COLD")]
        [DisplayName("ConeOfCold enemies number")]
        [Description("cast cone of cold when facing a value of mobs equals or greater than this value")]
        public int ConeOfColdCount { get; set; }

        [Setting]
        [DefaultValue(0)]
        [Category("TALENT")]
        [DisplayName("spamIceLanceForIcyVeinsTimer")]
        [Description("If talent Thermal Void is chosen, then this value represent the timer in millisecond to force spam iceLance to mantain IcyVeins buff. (default value this mechanic is disabled put as value 0!)")]
        public int spamIceLanceForIcyVeinsTimer { get; set; }
        

        [Setting]
        [DefaultValue(false)]
        [Category("CROWD CONTROL")]
        [DisplayName("Use FrostNova")]
        [Description("Chose to enable/disable automatic FrostNova")]
        public bool UseFrostNova { get; set; }
        
        [Setting]
        [DefaultValue(15)]
        [Category("DEFENSIVE")]
        [DisplayName("IceBlockHP")]
        [Description("Use Ice Block if hp lower than this value")]
        public int IceBlockHP { get; set; }

        [Setting]
        [DefaultValue(true)]
        [Category("DEFENSIVE")]
        [DisplayName("Use Ice Block")]
        [Description("Chose to enable/disable automatic IceBlock")]
        public bool IceBlockUse { get; set; }

        [Setting]
        [DefaultValue(15)]
        [Category("DEFENSIVE")]
        [DisplayName("ColdSnapHP")]
        [Description("Use ColdSnap if hp lower than this value")]
        public int ColdSnapHP { get; set; }

        [Setting]
        [DefaultValue(true)]
        [Category("DEFENSIVE")]
        [DisplayName("Use ColdSnap")]
        [Description("Chose to enable/disable automatic ColdSnap")]
        public bool ColdSnapUse { get; set; }

        [Setting]
        [DefaultValue(15)]
        [Category("DEFENSIVE")]
        [DisplayName("EvanesceHP")]
        [Description("Use Evanesce if hp lower than this value")]
        public int EvanesceHP { get; set; }

        [Setting]
        [DefaultValue(true)]
        [Category("DEFENSIVE")]
        [DisplayName("Use Evanesce")]
        [Description("Chose to enable/disable automatic Evanesce")]
        public bool EvanesceUse { get; set; }

        [Setting]
        [DefaultValue(true)]
        [Category("TALENT")]
        [DisplayName("Use RuneOfPower")]
        [Description("Chose to enable/disable if talented RuneOfPower")]
        public bool UseRuneOfPower { get; set; }

        [Setting]
        [DefaultValue(false)]
        [Category("SPECIAL")]
        [DisplayName("UseSpellSteal")]
        [Description("UseSpellSteal on focused target if exist or Current target")]
        public bool UseSpellSteal { get; set; }

        [Setting]
        [DefaultValue(false)]
        [Category("CROWD CONTROL")]
        [DisplayName("UsePolymorf")]
        [Description("UsePolymorf on focused target")]
        public bool UsePolymorf { get; set; }

        [Setting]
        [DefaultValue(true)]
        [Category("AOE")]
        [DisplayName("IceNova on cooldown")]
        [Description("cast IceNova on cooldown")]
        public bool iceNovaOnCooldown { get; set; }

        [Setting]
        [DefaultValue(true)]
        [Category("AOE")]
        [DisplayName("CometStorm on cooldown")]
        [Description("cast CometStorm on cooldown")]
        public bool cometStormOnCooldown { get; set; }

        [Setting]
        [DefaultValue(true)]
        [Category("AOE")]
        [DisplayName("UseBlizzard")]
        [Description("enable/disable use of Blizzard")]
        public bool UseBlizzard { get; set; }

        [Setting]
        [DefaultValue(2)]
        [Category("AOE")]
        [DisplayName("IceNova enemies number")]
        [Description("cast IceNova when on pack of mobs equals or greater than this value")]
        public int IceNovaCount { get; set; }

        [Setting]
        [DefaultValue(true)]
        [Category("AOE")]
        [DisplayName("IceNova on single target")]
        [Description("cast IceNova on single target when on there is no pack of mobs equals or greater than IceNova enemies number")]
        public bool IceNovaOnSingle { get; set; }

        [Setting]
        [DefaultValue(2)]
        [Category("AOE")]
        [DisplayName("CometStorm enemies number")]
        [Description("cast CometStorm when on pack of mobs equals or greater than this value")]
        public int CometStormCount { get; set; }

        [Setting]
        [DefaultValue(true)]
        [Category("AOE")]
        [DisplayName("CometStorm on single target")]
        [Description("cast CometStorm on single target when on there is no pack of mobs equals or greater than CometStorm enemies number")]
        public bool CometStormOnSingle { get; set; }

        [Setting, DefaultValue(Keys.None)]
        [Category("HOTKEY")]
        [DisplayName("PauseKey")]
        [Description("enable/disable Routine")]
        public Keys PauseKey { get; set; }

        [Setting, DefaultValue(Keys.None)]
        [Category("HOTKEY")]
        [DisplayName("AvoidAOEKey")]
        [Description("enable/disable AvoidAOE function")]
        public Keys AvoidAOEKey { get; set; }

        [Setting, DefaultValue(Keys.None)]
        [Category("HOTKEY")]
        [DisplayName("BurstKey")]
        [Description("Cast all CD and spells set on BurstHOTKEY")]
        public Keys BurstKey { get; set; }
        
    }
}
